Folder Structure
------------------------------------------------

- rawdata
    - ipums
    - dina_mss2021
    - cex_bm2016
    - cw_czone_state
    - cw_puma2000_czone
    - cw_ctygrp1980_czone
    - hpi
- empirics
    - data
    - julia
    - stata
    - results
        - data
        - figures
        - tables
- model
    - src
    - plots
    - tables
    - generated


rawdata
-------------------------------

The file "BertrandMorseTrickleCEXData.dta" was taken from the replication kit of Bertrand and Morse (2016) using the following link: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/XKHMUZ

The files in rawdata/cw_ctygrp1980_czone, rawdata/cw_puma2000_czone, and rawdata/cw_czone_state were downloaded from David Dorn's website: https://www.ddorn.net/data.htm
The files were originally created by Autor and Dorn (2013).

The Census/ACS data were downloaded from IPUMS USA. These data are a subsample of the IPUMS USA data available from usa.ipums.org. Source: Steven Ruggles, Sarah Flood, Matthew Sobek, Daniel Backman, Annie Chen, Grace Cooper, Stephanie Richards, Renae Rogers, and Megan Schouweiler. IPUMS USA: Version 15.0 [dataset]. Minneapolis, MN: IPUMS, 2024. https://www.ipums.org/projects/ipums-usa/d010.V15.0
The attached data file is intended only for replication purposes as part of this article. Individuals are not to redistribute the data without permission. Contact ipums@umn.edu for redistribution requests. For all other uses of these data, please access data directly via usa.ipums.org.

The HPI data are downloaded from https://www.fhfa.gov/DataTools/Downloads/Pages/House-Price-Index-Datasets.aspx#povol

The state-level DINA data, originally from Piketty, Saez and Zucman (2018), was taken from the replication kit of Mian, Straub and Sufi (2021), which can be downloaded using this link: http://scholar.harvard.edu/straub/MSSsavingglutreplication


empirics
-------------------------------

The files in empirics/stata clean the raw DINA, CEX and HPI data. The raw Census/ACS data are cleaned in Julia. The cleaned data used in the analysis are stored in empiris/data.

All empirical results are generated using the Julia code in empirics/julia and stored in empirics/results.
The files stored in empirics/results/data are input data for the quantitative analysis.

The Julia code in empirics was run with Julia 1.10. The Project.toml and Manifest.toml are part of the replication kit.


model
-------------------------------

The results were generated with Julia 1.11.4. The source code is in model/src/. For perfect reproducibility run the code using Pluto.jl (this ensures using the exact same package environment)

All code is in Pluto.jl notebooks. These notebooks

- To generate Figure 2 run tractable-plots.jl

- To re-generate all other figures and tables run
    - tractable-analysis.jl
    - tractable-transition.jl (Figures 7-9)
    - stepwise-transition.jl (Figure 10)
    - this overwrites model/plots/ and model/figures/

- To re-compute the calibration targets, run tractable-data.jl
    - this overwrites model/generated/{dina-targets-df,group-data,group-data2}.jl 

- To run (and overwrite) the calibration, run tractable-calibration.jl
    - this overwrites all model/generated/calibration-*-df.jl

- The other notebooks contain helper functions that are called from several other notebooks


Figures: files to replicate
-----------------------------------

Figure 1
empirics/results/figures/timeseries_aggregates.pdf
empirics/results/figures/scatter_mort2inc_nonmort2inc_by_topinc_dina.pdf

Figure 2
model/plots/simple-networks.pdf

Figure 3
model/plots/validation-groups-bars.pdf

Figure 4
empirics/results/figures/hist_incshare_top10_change_state_census.pdf
empirics/results/figures/hist_incshare_top10_change_czone_census.pdf

Figure 5
model/plots/redistribution-vary-ela.pdf

Figure 6
model/plots/redistribution-vary-sens.pdf

Figure 7
model/plots/redistribution-transition.pdf

Figure 8
model/plots/redistribution-transition-cohorts.pdf

Figure 9
model/plots/productivity-transition.pdf

Figure 10
model/plots/redistribution-transition-gradual.pdf

Figure A.1
empirics/results/figures/scatter_debt2inc_by_topinc_dina.pdf
empirics/results/figures/scatter_mort2inc_nonmort2inc_by_topinc_dina.pdf

Figure A.2
empirics/results/figures/longdiff_debtserv2inc_by_topinc_state.pdf
empirics/results/figures/longdiff_debtserv2inc_by_topinc_cz.pdf

Figure A.3
empirics/results/figures/longdiff_homeownership_by_topinc_state.pdf
empirics/results/figures/longdiff_homeownership_by_topinc_cz.pdf

Figure A.4
empirics/results/figures/longdiff_debtserv_by_topinc_bot50mid40_cz.pdf
empirics/results/figures/longdiff_debtserv_by_topinc_age_cz.pdf

Figure A.5
empirics/results/figures/longdiff_homeownership_by_topinc_bot50mid40_cz.pdf
empirics/results/figures/longdiff_homeownership_by_topinc_age_cz.pdf

Figure A.6
empirics/results/figures/scatter_ln_hpi_by_topincshare_dina.pdf

Figure B.1
model/plots/inequality_is_uneven_growth.pdf

Figure B.2
model/plots/example-R-sufficiently-popular.pdf

Figure D.1
empirics/results/figures/cex_expshare_housing.pdf

Figure D.2
empirics/results/figures/topincshare_by_agegroup_census.pdf

Figure D.3
model/plots/calibration-acs-ela=100.pdf

Figure D.4
model/plots/calibration-vary_ela.pdf

Figure D.5
model/plots/calibration-vary_sens.pdf


Tables: files to replicate
-----------------------------------

Table 3
model/tables/tractable-calibration.tex

Table 4
model/tables/tractable-model-fit.tex

Table 5
inequality-housing-mortgage-booms.tex

Table 6
model/tables/redistribution-dina-ela=100.tex

Table 7
model/tables/redistribution-census_acs-ela=100.tex

Table 8
model/tables/redistribution-groups-ela=100.tex

Table 9
model/tables/income_wealth_shares.tex

Table 10
model/tables/redistribution-networks-ela=100.tex

Table 11
model/tables/redistribution-deciles-ela=100.tex

Table 12
model/tables/redistribution-census_acs-young_agegroup-ela=100.tex

Table A.1
empirics/results/tables/dina_fe_debttypes.tex

Table A.2
empirics/results/tables/dina_fe_dynamic_mort.tex

Table A.3
empirics/results/tables/dina_fe_dynamic_ln_hpi.tex


References
-----------------------------------

David Autor and David Dorn. "The Growth of Low Skill Service Jobs and the Polarization of the U.S. Labor Market." American Economic Review, 103(5), 1553-1597, 2013.

Bertrand, Marianne, and Morse, Adair, (2016) "Trickle-Down Consumption." Review of Economics and Statistics 98:5, 863-879.

Atif Mian, Ludwig Straub, and Amir Sufi. "The Saving Glut of the Rich" NBER Working Paper Nr. 26941, 2021.
